
Product
Socket Now Supports pylock.toml Files
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
nuke-refresh-control
Advanced tools
RefreshControl 是一个能够实现下拉刷新的子组件,且父组件只能是 <Scrollview>
或 <ListView>
。
// 完整 demo 请参考 ScrollView 组件的 Demo
//初始 state
constructor() {
super();
this.state={
isRefreshing: false,
refreshText: '↓ 下拉刷新',
data:[
//...省略部分代码
]
}
}
handleRefresh =()=>{
this.setState({
isRefreshing: true,
refreshText: '加载中',
});
// mock ajax 此处替换为你的 ajax 请求
setTimeout(() => {
this.setState({
isRefreshing: false,
data: [
// data 字段变更
],
refreshText: '↓ 下拉刷新',
});
}, 1000);
}
render(){
return(
<ScrollView>
<RefreshControl isRefreshing={this.state.isRefreshing} style={{width:750,height:100}} onRefresh={this.handleRefresh}>
<Text>{this.state.refreshText}</Text>
</RefreshControl>
{/* 此处为你的内容区域 */}
<ScrollView>
)
}
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
isRefreshing | 是否展示 | false | |
onRefresh | refresh 事件 | Function | |
style | 样式,必须声明宽高否则可能无法展示 | object |
FAQs
The npm package nuke-refresh-control receives a total of 3 weekly downloads. As such, nuke-refresh-control popularity was classified as not popular.
We found that nuke-refresh-control demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.